<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http//www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <title>榆林科技馆内容页</title>
    <link rel="stylesheet" type="text/css" href="../css/main.css">
    <link rel="stylesheet" href="../css/kalendae.css" type="text/css">
    <link rel="stylesheet" type="text/css" href="../css/reset.css">

    <script type="text/javascript" src="./js/adddate.js"></script>
    <script type="text/javascript" src="./js/kalendae.standalone.js" charset="gbk"></script>
    <script type="text/javascript" src="../js/vue2.min.js"></script>
    <script type="text/javascript" src="../js/axios.min.js"></script>
    <script type="text/javascript">
        function check() {
            var1 = document.getElementById("txt_num"); //获取总人数
            var test = var1.value;
            var2 = document.getElementById("txtOrderNumber"); //获取网上预约人数
            var test1 = var2.value;
            if (parseInt(test1) > parseInt(test)) {
                alert("预约人数大于总人数");
                var2.value = "";
            }
        }
        function checkdate() {
            var1 = document.getElementById("TextBox3").value.replace(/\-/g, "\/"); //获取开馆时间
            var2 = document.getElementById("TextBox4").value.replace(/\-/g, "\/"); //获取闭馆时间
            if (var1 != "" && var2 != "" && var1 >= var2) {
                alert("闭馆时间不能大于开馆时间！");
                document.getElementById("TextBox4").value = "";
            }
        }
    </script>

</head>
<body>
<!--条件检索-->
<div align="center" id="v">
<form method="post" action="../cg?action=update" >



    <div class="update_box">
        <div class="kong">
        </div>
        <!--公用位置导航结束-->
        <div class="cont_box">

            <p class="title_bt">
                场次修改</p>
            <div class="biaodan_list">
                <table class="table_biaodan" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <input name="cgID" type="hidden" v-model="changci.cgID" id="changciId" class="input" placeholder="id" onkeyup="this.value=this.value.replace(/[^\d\.]/g, &#39;&#39;) ">
                    <tr>
                        <td class="biaodan_name">
                            <i>*</i>开馆日期：
                        </td>
                        <td class="biaodan_enter">
                            <input name="input0" type="text" v-model="changci.openDate" id="input0" placeholder="时间不能留空" class="input timeimg" onchange="checkdate()">
                            <script type="text/javascript" charset="utf-8">
                                var picker = new Kalendae.Input('input0',{
                                    months:3,
                                    mode:'multiple',
                                    direction: 'today-future',
                                    multipleDelimiter:',',
                                    format:'YYYY-MM-DD',
                                    titleFormat:'YYYY,MM'
                                });
                            </script>
                        </td>
                    </tr>
                    <tr>
                        <td class="biaodan_name">
                            <i>*</i> 可容纳人数：
                        </td>
                        <td class="biaodan_enter">
                            <input name="txt_num" type="text" v-model="changci.maxNumber" id="txt_num" class="input" placeholder="请输入人数" onkeyup="this.value=this.value.replace(/[^\d\.]/g, &#39;&#39;) ">
                        </td>
                    </tr>
                    <tr>
                        <td class="biaodan_name">
                            <i>*</i> 网上预约人数：
                        </td>
                        <td class="biaodan_enter">
                            <input name="txtOrderNumber" type="text" v-model="changci.maxOrderNumber" id="txtOrderNumber" class="input" placeholder="请输入人数" onkeyup="this.value=this.value.replace(/[^\d\.]/g, &#39;&#39;)" onblur=" check() ">
                        </td>
                    </tr>
                    <tr>
                        <td class="biaodan_name">
                            <i>*</i>开馆时间：
                        </td>
                        <td class="biaodan_enter">
                            <input name="TextBox3" type="text" v-model="changci.startTime" id="TextBox3" class="input timeimg" placeholder="请选择开馆时间" onclick="SelectDate(this,&#39;hh:mm:ss&#39;)" onchange="checkdate()">
                        </td>
                    </tr>
                    <tr>
                        <td class="biaodan_name">
                            <i>*</i>闭馆时间：
                        </td>
                        <td class="biaodan_enter">
                            <input name="TextBoxclose" type="text" v-model="changci.endTime" id="TextBoxclose" class="input timeimg" placeholder="请选择闭馆时间" onclick="SelectDate(this,&#39;hh:mm:ss&#39;)">
                        </td>
                    </tr>
                    <tr id="ss" style="display:none;height:110px;">
                        <td class="biaodan_name">
                            <i>*</i>审核状态：
                        </td>
                        <td class="biaodan_enter">
                            <select name="status"  id="DropDownList1" class="enter_k" placeholder="请选择">
                                <option value="2">--请选择---</option>
                                <option value="0">已审核</option>
                                <option value="1">未审核</option>

                            </select>
                        </td>
                    </tr>

                    </tbody>
                </table>
                <div class="anniu1" style="margin-left:300px;margin-top:20px;">
                    <input type="submit"  name="add" value="修改" id="add" class="btn btn-secondary radius">

                </div>
            </div>
        </div>
    </div>
</form>


</div>
</body>
<script>
    var v=new Vue({
        el:'#v',
        data:{
            changci:{
                cgID:"",
                openDate:"",
                maxNumber:"",
                maxOrderNumber: "",
                startTime:"",
                endTime:"",
                status:""
            }
        },
        methods:{
            update:function(){
                url="/cg?action=update";
                axios.get(url).then(res=>{


                    if(res.data=="success"){
                        window.location.href="Manage.html";

                    }
                });
                    }
        }

    });
    window.onload=init;
    function init(){
        alert(window.location.search)
        var url="/cg"+window.location.search+"&action=selectById";
        axios.get(url).then(res=>{
                console.log(res);
                v.changci=res.data;
            });
    }
</script></html>